//package com.wyq.new_springboot.config;
//
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import org.apache.ibatis.plugin.Interceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import org.springframework.web.servlet.config.annotation.*;
//
//@Configuration
////@EnableWebMvc
//public class UsingStaticController extends WebMvcConfigurationSupport {
//    // 分页插件
//    @Bean
//    public PaginationInterceptor paginationInterceptor() {
//        return new PaginationInterceptor();
//    }
//    //解决在拦截器中不能注入的问题
//    @Bean
//    public MyInterceptor myInterceptor(){
//        return new MyInterceptor();
//    }
//    @Override
//    protected void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(myInterceptor()).addPathPatterns("/**").
//                excludePathPatterns(
//                        "/test/login",
//                        "/test/register",
//                        "/test/doRegister",
//                        "/test/userLogin",
//                        "/static/**");
//    }
//
//    @Override
//    protected void addViewControllers(ViewControllerRegistry registry) {
//        super.addViewControllers(registry);
//    }
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
//        //registry.addResourceHandler("/css/**","/js/**").addResourceLocations("classpath:/static/css/","classpath:/static/js/");
//        //registry.addResourceHandler("/static/js/**").addResourceLocations("classpath:/static/js/");
//        //下面的这种写法，页面引入的时候前缀需要加上static，addResourceHandler只是一个逻辑的地址，不是实际地址，addResourceLocations表示要放开的资源
//
//        //添加上传图片的路径
//        //registry.addResourceHandler("/static/file/**").addResourceLocations("file:///C:/file");
//
//    }
//}
